//手工录入页面

Ext.DataEnteringPanel = Ext.extend(Ext.TabPanel,{
	initialized:false,
    initComponent:function(){
	    Ext.QuickTips.init();//显示消息
        Ext.form.Field.prototype.msgTarget='side';//再设置提示样式。
	    this.renderTo = document.body,
	    this.activeTab = 0,
	    this.plain = true,
//	    this.id = 'projectInsert',
	    this.defaults = {
	    		autoScroll: true
	    },
	    this.items = [{
	    	xtype:'form',
	    	labelAlign: 'right',
	    	labelWidth: 100,
	    	title:'项目基本信息',
	    	id:'projectbasicinfo',
	    	layout: 'form',
	    	frame: true,
	    	defaultType: 'textfield',
	    	defaults: {width: 300},
	    	items:[{
	    		xtype: 'textfield',
	    		fieldLabel: '项目编号',
	    		id : 'projectnumber',
	    		allowBlank: false,
	    		blankText: '请输入项目编号！',
	    		emptyText: '必填项'
	    	},{
	    		fieldLabel: '项目名称',
	    		id: 'projectname',
	    		allowBlank: false,
	    		blankText: '请输入项目名称！',
	    		emptyText: '必填项'
	    	},{
	    		fieldLabel: '所在地',
	    		id: this.id+'location'
	    	},{
/*主承担单位信息	*/    		
	    		xtype : 'fieldset',
           	    fieldLabel : '承担单位',
           	    layout : 'column',
           	    autoHeight: true,
           	    autoWidth: true,
           	    items : [{
           	    		xtype: 'label',
           	    		text:'单位名称：'
           	    },
	           	         {
	           	        	 xtype:'textfield',
	           	        	 emptyText:'承担单位',
	           	        	disabled:true,
	           	        	 readOnly: true,
	           	        	 id:'mainundertakeunitname'
	           	         },{ 
	           	        	 //用于表单传递给后台但不用显示出来的控件
	           	        	 xtype : 'hidden',
	           	        	 fiedLabel:'id',
	           	        	 id:'mainundertakeunit',
	           	        	 blankText:'单位ID',
	           	        	 readOnly : true,
	  		            	 name:'projectFee.undertakeunit'
	           	         },{
	           	        	 xtype:'button',
	           	        	 id:'xbutton',
	           	        	 text:'选择单位',
	           	        	 width: 80,
	           	        	 handler : function(b,e){
	           	        	 	var n = Ext.getCmp('dm_select_unit');
	           	        	 	if( n== null){
	           	        	 		n = new Ext.dm.ShowUnitWindow({
	           	        	 			id:'dm_select_unit',
	           	        	 			title:'选择单位',
	           	        	 			closable : true,
		           	        	 		buttons:[{
		           	     	            xtype:'button',
		           	     	            text : '确定',
		           	     	            handler : function(b,e){//把选择的值添加到单位输入框
		           	    					e.stopEvent();
		           	    					var a = b.findParentBy(function(ct, cmp) { 
		           	    						return (ct instanceof Ext.dm.ShowUnitWindow) ? true : false; 
		           	    					});
		           	    					
		           	     	             var record = a.sm.getSelections();
		           	     	             
		           	     	             if(record != null && record[0] != null){
		           	     	            	 var p = contentPanel.findById("projectInsert");
		           	     		             p.findById('mainundertakeunit').setValue(record[0].get('unitid'));
		           	     		             p.findById('mainundertakeunitname').setValue(record[0].get('unitname'));
		           	     		             a.close();
		           	     	             } else{
		           	     		             Ext.Msg.alert('请选择一项！');
		           	     	             }
		           	                  }
		           	    	          },{
		           	    	        	  xtype : 'button',
		           	    	        	  text : '取消',
		           	    	        	  handler : function(b, e){
		           	    					var a = b.findParentBy(function(ct, cmp) { 
		           	    						return (ct instanceof Ext.dm.ShowUnitWindow) ? true : false; 
		           	    					});
		           	    	        	  a.close();
		           	    	          }
		           	    	          }]
		           	        	 			
		           	        	 		});
		           	        	 	}
		           	        	 	n.findById('dm_unitgrid').store.load({
		           	        	 		params:{
		       	        	 			start:0,
		       	        	 			limit: 20
		           	        	 	}});
		           	        	 	n.show();
		           	         }
		           	         }]
	    	},{
/*联合单位一信息	  */  		
	    		xtype : 'fieldset',
           	    fieldLabel : '联合单位',
           	    layout : 'column',
           	    autoHeight: true,
           	    autoWidth: true,
           	    items : [{
           	    		xtype: 'label',
           	    		text:'单位名称：'
           	    },{
	           	        	 xtype:'textfield',
	           	        	 emptyText:'联合单位一',
	           	        	 disabled:true,
	           	        	 readOnly: true,
	           	        	 id:'unitedunitone'
	           	         },{ 
	           	        	 //用于表单传递给后台但不用显示出来的控件
	           	        	 xtype : 'hidden',
	           	        	 fiedLabel:'id',
	           	        	 id:'unitedunitoneid',
	           	        	 blankText:'单位ID',
	           	        	 readOnly : true,
	  		            	 name:'projectFee.undertakeunit'
	           	         },{
	           	        	 xtype:'button',
	           	        	 id:'xbutton',
	           	        	 text:'选择单位',
	           	        	 width: 80,
	           	        	 handler : function(b,e){
	           	        	 	var n = Ext.getCmp('dm_select_unit');
	           	        	 	if( n== null){
	           	        	 		n = new Ext.dm.ShowUnitWindow({
	           	        	 			id:'dm_select_unit',
	           	        	 			title:'选择单位',
	           	        	 			closable : true,
		           	        	 		buttons:[{
		           	     	            xtype:'button',
		           	     	            text : '确定',
		           	     	            handler : function(b,e){//把选择的值添加到单位输入框
		           	    					e.stopEvent();
		           	    					var a = b.findParentBy(function(ct, cmp) { 
		           	    						return (ct instanceof Ext.dm.ShowUnitWindow) ? true : false; 
		           	    					});
		           	    					
		           	     	             var record = a.sm.getSelections();
		           	     	             
		           	     	             if(record != null && record[0] != null){
		           	     	            	 var p = contentPanel.findById("projectInsert");
		           	     		             p.findById('unitedunitoneid').setValue(record[0].get('unitid'));
		           	     		             p.findById('unitedunitone').setValue(record[0].get('unitname'));
		           	     		             a.close();
		           	     	             } else{
		           	     		             Ext.Msg.alert('请选择一项！');
		           	     	             }
		           	                  }
		           	    	          },{
		           	    	        	  xtype : 'button',
		           	    	        	  text : '取消',
		           	    	        	  handler : function(b, e){
		           	    					var a = b.findParentBy(function(ct, cmp) { 
		           	    						return (ct instanceof Ext.dm.ShowUnitWindow) ? true : false; 
		           	    					});
		           	    	        	  a.close();
		           	    	          }
		           	    	          }]
	           	        	 		});
	           	        	 	}
	           	        	 	n.findById('dm_unitgrid').store.load({
	           	        	 		params:{
	       	        	 			start:0,
	       	        	 			limit: 20
	           	        	 	}});
	           	        	 	n.show();
	           	         }
	           	         }]
	    	},{
/*联合单位2信息	    */		
	    		xtype : 'fieldset',
           	    fieldLabel : '联合单位二',
           	    layout : 'column',
           	    autoHeight: true,
           	    autoWidth: true,
           	    items : [{
           	    		xtype: 'label',
           	    		text:'单位名称：'
           	    },
	           	         {
	           	        	 xtype:'textfield',
	           	        	 emptyText:'联合单位二',
	           	        	 readOnly: true,
	           	        	 disabled:true,
	           	        	 id:'unitedunittwo'
	           	         },{ 
	           	        	 //用于表单传递给后台但不用显示出来的控件
	           	        	 xtype : 'hidden',
	           	        	 fiedLabel:'id',
	           	        	 id:'unitedunittwoid',
	           	        	blankText:'单位ID',
	           	        	 readOnly : true,
	  		            	 name:'projectFee.undertakeunit'
	           	         },{
	           	        	 xtype:'button',
	           	        	 id:'xbutton',
	           	        	 text:'选择单位',
	           	        	 width: 80,
	           	        	 handler : function(b,e){
	           	        	 	var n = Ext.getCmp('dm_select_unit');
	           	        	 	if( n== null){
	           	        	 		n = new Ext.dm.ShowUnitWindow({
	           	        	 			id:'dm_select_unit',
	           	        	 			title:'选择单位',
	           	        	 			closable : true,
		           	        	 		buttons:[{
		           	     	            xtype:'button',
		           	     	            text : '确定',
		           	     	            handler : function(b,e){//把选择的值添加到单位输入框
		           	    					e.stopEvent();
		           	    					var a = b.findParentBy(function(ct, cmp) { 
		           	    						return (ct instanceof Ext.dm.ShowUnitWindow) ? true : false; 
		           	    					});
		           	    					
		           	     	             var record = a.sm.getSelections();
		           	     	             
		           	     	             if(record != null && record[0] != null){
		           	     	            	 var p = contentPanel.findById("projectInsert");
		           	     		             p.findById('unitedunittwoid').setValue(record[0].get('unitid'));
		           	     		             p.findById('unitedunittwo').setValue(record[0].get('unitname'));
		           	     		             a.close();
		           	     	             } else{
		           	     		             Ext.Msg.alert('请选择一项！');
		           	     	             }
		           	                  }
		           	    	          },{
		           	    	        	  xtype : 'button',
		           	    	        	  text : '取消',
		           	    	        	  handler : function(b, e){
		           	    					var a = b.findParentBy(function(ct, cmp) { 
		           	    						return (ct instanceof Ext.dm.ShowUnitWindow) ? true : false; 
		           	    					});
		           	    	        	  a.close();
		           	    	          }
		           	    	          }]
	           	        	 		});
	           	        	 	}
	           	        	 	n.findById('dm_unitgrid').store.load({
	           	        	 		params:{
	       	        	 			start:0,
	       	        	 			limit: 20
	           	        	 	}});
	           	        	 	n.show();
	           	         }
	           	         }]
	    	
	    	},{
/*保证单位信息      */
	    		xtype : 'fieldset',
           	    fieldLabel : '保证单位',
           	    layout : 'column',
           	    autoHeight: true,
           	    autoWidth: true,
           	    items : [{
           	    		xtype: 'label',
           	    		text:'单位名称：'
           	    },
	           	         {
	           	        	 xtype:'textfield',
	           	        	 emptyText:'保证单位',
	           	        	 readOnly: true,
	           	        	 id:'guaranteeunit',
	           	        	 disabled:true
	           	         },{ 
	           	        	 //用于表单传递给后台但不用显示出来的控件
	           	        	 xtype : 'hidden',
	           	        	 fiedLabel:'id',
	           	        	 id:'guaranteeunitid',
	           	        	blankText:'单位ID',
	           	        	 readOnly : true,
	  		            	 name:'projectFee.undertakeunit'
	           	         },{
	           	        	 xtype:'button',
	           	        	 id:'xbutton',
	           	        	 text:'选择单位',
	           	        	 width: 80,
	           	        	 handler : function(b,e){
	           	        	 	var n = Ext.getCmp('dm_select_unit');
	           	        	 	if( n== null){
	           	        	 		n = new Ext.dm.ShowUnitWindow({
	           	        	 			id:'dm_select_unit',
	           	        	 			title:'选择单位',
	           	        	 			closable : true,
		           	        	 		buttons:[{
		           	     	            xtype:'button',
		           	     	            text : '确定',
		           	     	            handler : function(b,e){//把选择的值添加到单位输入框
		           	    					e.stopEvent();
		           	    					var a = b.findParentBy(function(ct, cmp) { 
		           	    						return (ct instanceof Ext.dm.ShowUnitWindow) ? true : false; 
		           	    					});
		           	    					
		           	     	             var record = a.sm.getSelections();
		           	     	             
		           	     	             if(record != null && record[0] != null){
		           	     	            	 var p = contentPanel.findById("projectInsert");
		           	     		             p.findById('guaranteeunitid').setValue(record[0].get('unitid'));
		           	     		             p.findById('guaranteeunit').setValue(record[0].get('unitname'));
		           	     		             a.close();
		           	     	             } else{
		           	     		             Ext.Msg.alert('请选择一项！');
		           	     	             }
		           	                  }
		           	    	          },{
		           	    	        	  xtype : 'button',
		           	    	        	  text : '取消',
		           	    	        	  handler : function(b, e){
		           	    					var a = b.findParentBy(function(ct, cmp) { 
		           	    						return (ct instanceof Ext.dm.ShowUnitWindow) ? true : false; 
		           	    					});
		           	    	        	  a.close();
		           	    	          }
		           	    	          }]
	           	        	 		});
	           	        	 	}
	           	        	 	n.findById('dm_unitgrid').store.load({
	           	        	 		params:{
	       	        	 			start:0,
	       	        	 			limit: 20
	           	        	 	}});
	           	        	 	n.show();
	           	         }
	           	         }]
	    	
	    	},{
	    		xtype: 'datefield',
	    		fieldLabel: '立项年度',
	    		id: 'establishprojectyear',
	    		format : 'Y'
	    	},{
	    		fieldLabel: '主管处室',
	    		id: 'mainmanagingdepartment'
//	    	},{
//	    		xtype: 'combobox',
//	    		store: store,
//	    		emptyText: '请选择跟进人！',
//	    		mode: 'local' ,
//	    		triggerAction:  'all',
//	    		valueField: 'value',
//	    		displayField: 'text'
	    	}]
	    },{
	    	xtype:'form',
	    	labelAlign: 'right',
	    	labelWidth: 100,
	    	title:'项目详细信息',
	    	id: 'projectdetails',
	    	layout: 'form',
		    frame: true,
		    defaultType: 'textfield',
		    defaults:{
	    	  width: 300
	    },
		    items:[{
		    	fieldLabel: '项目计划类别',
	    		id: 'projectplancatagory'
		    },{
		    	fieldLabel: '招标项目名称',
	    		id: this.id+'field'
		    },{
		    	fieldLabel: '子项目名称',
	    		id: this.id+'subfield'
		    },{
		    	xtype: 'textfield',
		    	fieldLabel: '下达文件编号',
		    	id: 'issuefilenumber'
		    },{
		    	xtype: 'datefield',
		    	fieldLabel: '合同开始日期',
		    	format : 'Y-m-d',
		    	id: 'contractbegin'
		    },{
		    	xtype: 'datefield',
		    	fieldLabel: '合同结束日期',
		    	format : 'Y-m-d',
		    	id: 'contractend'
		    },{
		    	xtype: 'numberfield',
		    	fieldLabel: '中标金额（万元）',
		    	id: 'winbidmoney'
		    },{
/*项目负责人信息   */		    	
		    	xtype : 'fieldset',
	          	fieldLabel : '项目负责人',
//	          	layout : 'column',
	          	autoHeight: true,
	          	autoWidth: true,
	          	items : [
	          	         {
	          	        	 xtype: 'label',
	          	        	 text: '项目负责人'
	          	         },
	          	         {
	          	        	 xtype:'textfield',
	          	        	 blankText:'项目负责人',
	          	        	 fiedLabel:'项目负责人',
	          	        	 readOnly : true,
	          	        	 disabled:true,
	          	        	 id:'projectdirectorname'
	          	         },{ 
	          	        	 //用于表单传递给后台但不用显示出来的控件
	          	        	 xtype : 'hidden',
	          	        	 fiedLabel:'id',
	          	        	 id:'projectdirector',
	          	        	 readOnly : true
	          	         },{
	 						xtype: 'numberfield',
					    	fieldLabel: '办公电话',
					    	id: 'officephone'
						 },{
							xtype: 'numberfield',
					    	fieldLabel: '移动电话',
					    	id: 'mobilephone'
						 },{
							xtype: 'textfield',
							fieldLabel: '负责人email',
							id: 'email'
						 },{
	          	        	 xtype:'button',
	          	        	 text:'选择项目负责人',
	          	        	 width: 80,
	          	        	 handler : function(b,e){
	
	          	        	 	var n = Ext.getCmp('dm_selectdirector');
	          	        	 	if( n== null){
	          	        	 		n = new Ext.dm.ShowDirectorWindow({
	          	        	 			id:'dm_selectdirector',
	          	        	 			title:'选择负责人',
	          	        	 			closable : true,
	          	        	 			buttons : [{
	          	       	        	    xtype:'button',
	          	       	        	    text : '确定',
	          	       	        	    handler : function(b,e){
	          	       		
	          	       					e.stopEvent();
	          	       						var a = b.findParentBy(function(ct, cmp) { 
	          	       								return (ct instanceof Ext.dm.ShowDirectorWindow) ? true : false; 
	          	       						});
	          	       		

	          	       	        	   var record = a.sm.getSelections();
	          	       	        	   if(record != null && record[0] != null){
	          	       	        		   var p = contentPanel.findById("projectInsert");
	          	       	        		   p.findById('projectdirector').setValue(record[0].get('personid'));
	          	       	        		   p.findById('projectdirectorname').setValue(record[0].get('name'));
	          	       	        		   p.findById('officephone').setValue(record[0].get('phone'));
	          	       	        		   p.findById('email').setValue(record[0].get('email'));
	          	       	        		   a.close();
	          	       	        	   } else{
	          	       	        		   Ext.Msg.alert('请选择一项！');
	          	       	        	   }
	          	       	           }
	          	       	           },{
	          	       	        	   xtype : 'button',
	          	       	        	   text : '取消',
	          	       	        	   handler : function(b, e){
	          	       	        	   		var a = b.findParentBy(function(ct, cmp) { 
	          	       	        	   			return (ct instanceof Ext.dm.ShowDirectorWindow) ? true : false; 
	          	       	        	   		});
	          	       	        	   		a.close();
	          	       	           }
	          	       	           }]
	          	        	 		});
	          	        	 	}
	          	        	 	n.grid.store.load({
	          	        	 		params:{
	          	        	 			start:0,
	          	        	 			limit: 20
	          	        	 	}
	          	        	 	});
	          	        	 	n.show();
	          	         
	          	         }
	          	         }]
		    },{
/*项目联系人信息   */		    	
		    	xtype : 'fieldset',
	          	fieldLabel : '项目联系人',
//	          	layout : 'column',
	          	autoHeight: true,
	          	autoWidth: true,
	          	items : [{
	          	        	 xtype: 'label',
	          	        	 text: '项目负责人'
	          	         },{
	          	        	 xtype:'textfield',
	          	        	 blankText:'项目联系人',
	          	        	 fiedLabel:'项目联系人',
	          	        	disabled:true,
	          	        	 readOnly : true,
	          	        	 id:'contactman'
	          	         },{ 
	          	        	 //用于表单传递给后台但不用显示出来的控件
	          	        	 xtype : 'hidden',
	          	        	 fiedLabel:'id',
	          	        	 id:'contactmanid',
	          	        	 readOnly : true
	          	         },{
	 						xtype: 'numberfield',
					    	fieldLabel: '电话一',
					    	id: 'phoneone'
						 },{
							xtype: 'numberfield',
					    	fieldLabel: '电话二',
					    	id: 'phonetwo'
						 },{
							xtype: 'textfield',
							fieldLabel: '联系人email',
							id: 'contactmanemail'
						 },{
	          	        	 xtype:'button',
	          	        	 text:'选择项目联系人',
	          	        	 width: 80,
	          	        	 handler : function(b,e){
	
	          	        	 	var n = Ext.getCmp('dm_selectdirector');
	          	        	 	if( n== null){
	          	        	 		n = new Ext.dm.ShowDirectorWindow({
	          	        	 			id:'dm_selectdirector',
	          	        	 			title:'选择单位',
	          	        	 			closable : true,
	          	        	 			buttons : [{
	          	       	        	    xtype:'button',
	          	       	        	    text : '确定',
	          	       	        	    handler : function(b,e){
	          	       		
	          	       					e.stopEvent();
	          	       						var a = b.findParentBy(function(ct, cmp) { 
	          	       								return (ct instanceof Ext.dm.ShowDirectorWindow) ? true : false; 
	          	       						});
	          	       		

	          	       	        	   var record = a.sm.getSelections();
	          	       	        	   if(record != null && record[0] != null){
	          	       	        		   var p = contentPanel.findById("projectInsert");
	          	       	        		   p.findById('contactmanid').setValue(record[0].get('personid'));
	          	       	        		   p.findById('contactman').setValue(record[0].get('name'));
	          	       	        		   p.findById('phoneone').setValue(record[0].get('phone'));
	          	       	        		   p.findById('contactmanemail').setValue(record[0].get('email'));
	          	       	        		   a.close();
	          	       	        	   } else{
	          	       	        		   Ext.Msg.alert('请选择一项！');
	          	       	        	   }
	          	       	           }
	          	       	           },{
	          	       	        	   xtype : 'button',
	          	       	        	   text : '取消',
	          	       	        	   handler : function(b, e){
	          	       	        	   		var a = b.findParentBy(function(ct, cmp) { 
	          	       	        	   			return (ct instanceof Ext.dm.ShowDirectorWindow) ? true : false; 
	          	       	        	   		});
	          	       	        	   		a.close();
	          	       	           }
	          	       	           }]
	          	        	 		});
	          	        	 	}
	          	        	 	n.grid.store.load({
	          	        	 		params:{
	          	        	 			start:0,
	          	        	 			limit: 20
	          	        	 	}
	          	        	 	});
	          	        	 	n.show();
	          	         
	          	         }
	          	         }]
		    }]
		    },{
		    	xtype:'form',
	    	    labelAlign: 'right',
	    	    labelWidth: 100,
	    	    title:'项目验收信息',
	    	    layout: 'form',
	    	    id: 'projectcheck',
		        frame: true,
		        defaultType: 'textfield',
		        defaults:{
		    	     width:300 
		       },
		        items: [{
		    	xtype: 'datefield',
		    	fieldLabel: '验收时间',
		    	format : 'Y-m-d',
		    	id: 'checkdate'
		    },{
		    	xtype: 'combo',
		    	fieldLabel: '项目进度',
		    	id: 'projectschedule',
		    	store: new Ext.data.SimpleStore({
		    		fields: ['value','text'],
		    		data: [
		    		       ['0','合同评审阶段'],
		    		       ['1','实施阶段'],
		    		       ['2','已到期未验收'],
		    		       ['3','已验收'],
		    		       ['4','延期'],
		    		       ['5','合同签订'],
		    		       ['6','项目实施'],
		    		       ['7','项目到期未验收'],
		    		       ['8','准备验收'],
		    		       ['9','结题']
		    		       ]
		    	}),
		    	displayField: 'text',
		    	valueField: 'value',
		    	triggerAction:  'all',
		    	mode: 'local',
		    	emptyText: '请选择'
		    
		    },{
		    	xtype: 'combo',
		    	fieldLabel: '项目变更情况',
		    	id: 'projectchange',
		    	store: new Ext.data.SimpleStore({
		    		fields: ['value','text'],
		    		data: [
		    		       ['1','已完成项目负责人变更'],
		    		       ['2','已提出延期申请变更']
		    		       ]
		    	}),
		    	displayField: 'text',
		    	valueField: 'value',
		    	triggerAction:  'all',
		    	mode: 'local',
		    	emptyText: '请选择'
		    	    
		    }]
	    },{
	    	xtype:'form',
	    	title:'项目合同要求成果形式',
	    	labelAlign: 'right',
	    	labelWidth: 100,
	    	layout: 'form',
	    	id: 'projectcontractforms',
	    	frame: true,
	    	defaultType: 'textfield',
	    	defaults:{
	    	  width:300 
	    },
	    	items: [{
	    		xtype : 'fieldset',
                title :'发明专利',
                collapsible : true, //可折叠
                collapseFirst : true,
                fieldLabel: '发明专利',
                autoHeight: true,
                layout: 'form',
                items: [{
                	xtype: 'numberfield',
    		    	fieldLabel: '申请',
    		    	id: 'inventpatentapplication'
    		    	
    	    	},{
    	    		xtype: 'numberfield',
    		    	fieldLabel: '授权',
    		    	id: 'inventpatentauthorization'
                }]
	    	},{
	    		xtype : 'fieldset',
                title :'实用新型',
                collapsible : true, //可折叠
                collapseFirst : true,
                fieldLabel: '实用新型',
                autoHeight: true,
                layout: 'form',
                items: [{
                	xtype: 'numberfield',
    		    	fieldLabel: '申请',
    		    	id: 'usenewapplication'
    		    	
    	    	},{
    	    		xtype: 'numberfield',
    		    	fieldLabel: '授权',
    		    	id: 'usenewauthorization'
                }]
	    	
	    	},{
	    		xtype : 'fieldset',
                title :'外观设计',
                collapsible : true, //可折叠
                collapseFirst : true,
                fieldLabel: '外观设计',
                autoHeight: true,
                layout: 'form',
                items: [{
                	xtype: 'numberfield',
    		    	fieldLabel: '申请',
    		    	id: 'appearancedesignapplication'
    		    	
    	    	},{
    	    		xtype: 'numberfield',
    		    	fieldLabel: '授权',
    		    	id: 'appearancedesignauthorization'
                }]
	    	},{
	    		xtype: 'numberfield',
		    	fieldLabel: '外国专利',
		    	id: 'foreignpatent'
	    	},{
	    		xtype: 'numberfield',
		    	fieldLabel: '新工艺',
		    	id: 'newtechnology'
	    	},{
	    		xtype: 'numberfield',
		    	fieldLabel: '新产品',
		    	id: 'newproduct'
	    	},{
	    		xtype: 'numberfield',
		    	fieldLabel: '新材料',
		    	id: 'newmaterial'
	    	},{
	    		xtype: 'numberfield',
		    	fieldLabel: '新设备',
		    	id: 'newequipment'
	    	},{
	    		xtype: 'numberfield',
		    	fieldLabel: '计算机软件',
		    	id: 'computersoftware'
	    	},{
	    		xtype: 'numberfield',
		    	fieldLabel: '论文论著',
		    	id: 'paper'
	    	},{
	    		xtype: 'numberfield',
		    	fieldLabel: '技术标准',
		    	id: 'technologystandard'
	    	},{
	    		xtype : 'fieldset',
                title :'科技成果奖励',
                collapsible : true, //可折叠
                collapseFirst : true,
                fieldLabel: '科技成果奖励',
                autoHeight: true,
                layout: 'form',
                items: [{
                	xtype: 'numberfield',
                	fieldLabel: '国家级',
//    		    	width: 50,
    		    	id: 'nationalaward'
                },{
                	xtype: 'numberfield',
    		    	fieldLabel: '省部级',
    		    	id: 'provincialaward'
                },{
                	xtype: 'numberfield',
    		    	fieldLabel: '市级',
    		    	id: 'cityaward'
                }]
	    	},{
	    		xtype : 'fieldset',
                title :'培养人才',
                collapsible : true, //可折叠
                collapseFirst : true,
                fieldLabel: '培养人才',
                autoHeight: true,
                layout: 'form',
                items: [{
                	xtype: 'numberfield',
    		    	fieldLabel: '博士',
    		    	id: 'doctor'
                },{
                	xtype: 'numberfield',
    		    	fieldLabel: '硕士',
    		    	id: 'master'
                },{
                	xtype: 'numberfield',
    		    	fieldLabel: '本科',
    		    	id: 'undergraduate'
                }]
	    	},{

	    		xtype: 'numberfield',
		    	fieldLabel: '到位经费（万元）',
		    	id: 'fundsavailable'
	    	},{
	    		xtype: 'numberfield',
		    	fieldLabel: '经费投入（万元）',
		    	id: 'fundsinvestment'
	    	},{
	    		xtype: 'numberfield',
		    	fieldLabel: '已获收益（万元）',
		    	id: 'benefitacquired'
	    	}]
	    },{
	    	xtype:'form',
	    	title:'项目总结',
	    	labelAlign: 'right',
	    	layout:'form',
	    	labelWidth: 100,
	    	id: 'projectsummarylabel',
	    	frame: true,
	    	items: [{
	    		xtype: 'textarea',
	    		fieldLabel: '项目总结',
	    		id:'projectsummary',
	    		width: 500,
	    		grow: true,
	    		preventScrollbars: true,
	    		allowBlank: true
	    	}],
	    	buttons:[{
	    		text: '写入',
	    		handler: function(b,e) {
					var a = b.findParentBy(function(ct, cmp) { 
						return (ct instanceof Ext.DataEnteringPanel) ? true : false; 
					});
					
	    		Ext.Ajax.request({
	    			url:'dataManage/dataManageAction!addProject',
   			        method: 'POST',
   			        params: {
	    			     /*项目基本信息   */
   		    	         projectnumber: Ext.getCmp('projectbasicinfo').findById('projectnumber').getValue(),  //项目编号
   		    	         projectname: Ext.getCmp('projectbasicinfo').findById('projectname').getValue(),    //项目名称
   		    	         location: Ext.getCmp('projectbasicinfo').findById('projectInsertlocation').getValue(),    //项目所在地
   		    	         
   		    	         /*承担单位 */
   		    	         mainundertakeunit: Ext.getCmp('projectbasicinfo').findById('mainundertakeunit').getValue(), 
   		    	         
   		    	         /*联合单位1 */
   		    	         unitedunitone: Ext.getCmp('projectbasicinfo').findById('unitedunitoneid').getValue(),
   		    	         
   		    	         /*联合单位2 */
   		    	         unitedunittwo: Ext.getCmp('projectbasicinfo').findById('unitedunittwoid').getValue(),
   		    	         
   		    	         /*保证单位 */
   		    	         guaranteeunit: Ext.getCmp('projectbasicinfo').findById('guaranteeunitid').getValue(),
   		    	         
   		    	         establishprojectyear: Ext.getCmp('projectbasicinfo').findById('establishprojectyear').getRawValue(), //立项年度
   		    	         mainmanagingdepartment: Ext.getCmp('projectbasicinfo').findById('mainmanagingdepartment').getValue(), //主管处室
   		    	         
   		    	         /*项目详细信息  */
   		    	         projectplancatagory: Ext.getCmp('projectdetails').findById('projectplancatagory').getValue(), //项目计划类别
   		    	         field: Ext.getCmp('projectdetails').findById('projectInsertfield').getValue(), //领域       id有错误需要修改
   		    	         subfield: Ext.getCmp('projectdetails').findById('projectInsertsubfield').getValue(), //子领域
   		    	         issuefilenumber: Ext.getCmp('projectdetails').findById('issuefilenumber').getValue(), //下达文件编号
   		    	         contractbegin: Ext.getCmp('projectdetails').findById('contractbegin').getRawValue(), //合同开始时间
   		    	         contractend: Ext.getCmp('projectdetails').findById('contractend').getRawValue(), //合同结束时间
   		    	         winbidmoney: Ext.getCmp('projectdetails').findById('winbidmoney').getValue(), //中标金额
   		    	         
   		    	         /*项目负责人   */
   		    	         projectdirector: Ext.getCmp('projectdetails').findById('projectdirector').getValue(),
   		    	         officephone: Ext.getCmp('projectdetails').findById('officephone').getValue(),
   		    	         mobilephone: Ext.getCmp('projectdetails').findById('mobilephone').getValue(),
   		    	         directoremail: Ext.getCmp('projectdetails').findById('email').getValue(),
   		    	         
   		    	         /*项目联系人   */
   		    	         contactman: Ext.getCmp('projectdetails').findById('contactmanid').getValue(),
   		    	         phoneone: Ext.getCmp('projectdetails').findById('phoneone').getValue(),
   		    	         phonetwo: Ext.getCmp('projectdetails').findById('phonetwo').getValue(),
   		    	         contactmanemail: Ext.getCmp('projectdetails').findById('contactmanemail').getValue(),
   		    	         
   		    	         /*项目验收情况    */
   		    	         checkdate: Ext.getCmp('projectcheck').findById('checkdate').getRawValue(),  //验收时间
   		    	         projectschedule: Ext.getCmp('projectcheck').findById('projectschedule').getValue(),
   		    	         projectchange: Ext.getCmp('projectcheck').findById('projectchange').getValue(),
   		    	         
   		    	         /*项目合同成果要求形式   */
   		    	         inventpatentapplication: Ext.getCmp('projectcontractforms').findById('inventpatentapplication').getValue(),
   		    	         inventpatentauthorization: Ext.getCmp('projectcontractforms').findById('inventpatentauthorization').getValue(),
   		    	         usenewapplication: Ext.getCmp('projectcontractforms').findById('usenewapplication').getValue(),
   		    	         usenewauthorization: Ext.getCmp('projectcontractforms').findById('usenewauthorization').getValue(),
   		    	         appearancedesignapplication: Ext.getCmp('projectcontractforms').findById('appearancedesignapplication').getValue(), //外观设计申请
   		    	         appearancedesignauthorization: Ext.getCmp('projectcontractforms').findById('appearancedesignauthorization').getValue(),
   		    	         foreignpatent: Ext.getCmp('projectcontractforms').findById('foreignpatent').getValue(),
   		    	         newtechnology: Ext.getCmp('projectcontractforms').findById('newtechnology').getValue(),
   		    	         newproduct: Ext.getCmp('projectcontractforms').findById('newproduct').getValue(),
   		    	         newmaterial: Ext.getCmp('projectcontractforms').findById('newmaterial').getValue(),
   		    	         newequipment: Ext.getCmp('projectcontractforms').findById('newequipment').getValue(),
   		    	         computersoftware: Ext.getCmp('projectcontractforms').findById('computersoftware').getValue(),
   		    	         paper: Ext.getCmp('projectcontractforms').findById('paper').getValue(),
   		    	         technologystandard: Ext.getCmp('projectcontractforms').findById('technologystandard').getValue(), //技术标准
   		    	         
   		    	         /*科技成果奖励 */
   		    	         nationalaward: Ext.getCmp('projectcontractforms').findById('nationalaward').getValue(),
   		    	         provincialaward: Ext.getCmp('projectcontractforms').findById('provincialaward').getValue(),
   		    	         cityaward: Ext.getCmp('projectcontractforms').findById('cityaward').getValue(),
   		    	         
   		    	         /*培养人才  */
   		    	         doctor: Ext.getCmp('projectcontractforms').findById('doctor').getValue(),
   		    	         master: Ext.getCmp('projectcontractforms').findById('master').getValue(),
   		    	         undergraduate: Ext.getCmp('projectcontractforms').findById('undergraduate').getValue(),
   		    	         
   		    	         fundsavailable: Ext.getCmp('projectcontractforms').findById('fundsavailable').getValue(), //到位经费
   		    	         fundsinvestment: Ext.getCmp('projectcontractforms').findById('fundsinvestment').getValue(),  //投入经费
   		    	         benefitacquired: Ext.getCmp('projectcontractforms').findById('benefitacquired').getValue(),  //已获收益
   		    	         
   		    	         /* 项目总结  */
   		    	         projectsummary: Ext.getCmp('projectsummarylabel').findById('projectsummary').getValue()
   		              },
   		              success : function(form,action){
   		            	 Ext.Msg.alert('提示','提交成功！');
   		              },
   		              failure : function(form,action){
   		            	 Ext.Msg.alert('提示','提交失败！');
   		              }
	    		});
	    		    
	    	     }
	    	},{
	    		text: '清空',
	    		handler: function() {
	    		Ext.Msg.alert('警告','清空会消除已填的项目信息，请确定。')
	    		Ext.getCmp('projectbasicinfo').form.reset();
	    		Ext.getCmp('projectdetails').form.reset();
	    		Ext.getCmp('projectcheck').form.reset();
	    		Ext.getCmp('projectcontractforms').form.reset();
	    		Ext.getCmp('projectsummarylabel').form.reset();
	    		Ext.Msg.alert('提示','数据已清空！');
	    	}
	    	}]
	    }];
    Ext.DataEnteringPanel.superclass.initComponent.call(this);
}
})